<template>
  <el-row :gutter="20">
    <el-col :span="12">
      <el-form-item label="最小长度" prop="minLength">
        <el-input-number v-model="item.minLength" />
      </el-form-item>
    </el-col>
    <el-col :span="12">
      <el-form-item label="最大长度" prop="maxLength">
        <el-input-number v-model="item.maxLength" />
      </el-form-item>
    </el-col>
    <el-col :span="12">
      <el-form-item v-if="item.type === 'textarea'" label="文本行数" prop="rowLength">
        <el-input-number v-model="item.rowLength" />
      </el-form-item>
    </el-col>
  </el-row>
  <el-form-item label="占位字符" prop="placeholder">
    <el-input v-model="item.placeholder" placeholder="未填入数据时显示的内容" :maxLength="20" clearable></el-input>
  </el-form-item>
</template>

<script lang="ts" setup >
import { IFormItem } from "../../../type";

interface IProps {
  item: IFormItem
}
interface IEmit {
  (event: "fixData", data: any): void
}
const props = defineProps<IProps>()
const emit = defineEmits<IEmit>()
</script>

<style scoped>
/* styles go here */
</style>
